﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;
using System.Text;
namespace IHISCETeim.Web.MachineSys.FTradeModel
{
    public partial class GetPageFTradeSaleTypeConfigAdd : PageBase
    {
        protected override string DWZRef
        {
            get
            {
                return "FTradeReceivablesAdd";
            }
        }
        /// <summary>
        /// 不用权限
        /// </summary>
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.none };
            }
        }
        /// <summary>
        /// 获取当前要使用的销售类型
        /// </summary>
        protected string XiaoShouLeiXing
        {
            get
            {
                return GetRequestValue<string>("key","");
            }
        }

        protected string Summary
        {
            get
            { 
                FTradeSaleTypeConfigInfo obj=  FTradeSaleTypeConfigController.GetByName(XiaoShouLeiXing);
                return obj.Summary;
            }
        }


        private string GetPageShowDate()
        {
            int addIndex = GetRequestValue<int>("addIndex", 0);
            DateTime lastDaoQiRi = GetRequestValue<DateTime>("lastDaoQiRi", DateTime.Now);
            return lastDaoQiRi.AddMonths(addIndex).ToString("yyyy-MM-20");
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "addmonth")
            {
                Response.Write(GetPageShowDate());
                Response.End();
            }
            if (GetRequestValue<string>("ajaxmethod", "") == "getconfigsummary")
            {
                Response.Write(Summary);
                Response.End();
            }
           
        }
    }
}